 
<%@page import="doantotnghiep.modelDTO.WorkPlaymentDTO"%>
<%@page import="java.util.HashMap"%>
<%@page import="doantotnghiep.modelDTO.DivisionRoomDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="doantotnghiep.model.Customer"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@page import="java.util.ArrayList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cập nhật nhân viên</title>
</head>
<body>
<% HashMap<String, Object> staffModel = (HashMap<String, Object>) request.getAttribute("staffModel"); %>
<br>
<br>
		<h1 style="color: white;"></h1>
		<br> <br>
		<h1 style="color: blue;">CẬP NHẬT THÔNG TIN NHÂN VIÊN</h1>
		<p style="color: green; font-size: 15px; font-weight: bold;">
		</p>
		<br>
		<div align="center">

       <form:form method="POST" commandName="StaffDTO" >
		<table>
			<form:hidden path="id" value="${staffModel.staffDTO.id}" />
			<tr>
				<td><form:label path="fullName">Họ tên nhân viên:</form:label></td>
				<td><form:input id= "staffname" path="fullName"value="${staffModel.staffDTO.fullName}"></form:input></td>
				<td><span id="staffname-error" style="color:red"> </span></td>
			</tr>
			<tr>
				<td><form:label  path="birthDay">Ngày sinh:</form:label></td>
				<td><form:input id= "birthDay" path="birthDay" value="${staffModel.staffDTO.birthDay}"></form:input>*</td>
				<td><span id="staffbirthday-error" style="color:red"> </span></td>
			</tr>
			<tr>
				<td><form:label  path="identifyNumber">Số CMND:</form:label></td>
				<td><form:input id= "identifyNumber" path="identifyNumber" value="${staffModel.staffDTO.identifyNumber}"></form:input>*</td>
				<td><span id="staffidentifynumber-error" style="color:red"> </span></td>
			</tr>
			<tr>
				<td><form:label path="address">Địa chỉ:</form:label></td>
				<td><form:input id="staffaddress" path="address" value="${staffModel.staffDTO.address}" /></td>	
				<td><span id="staffaddress-error" style="color:red"> </span></td>
			</tr>
            <tr>
				<td><form:label path="telNumber">Điện thoại:</form:label></td>
				<td><form:input  id="stafftelnumber" path="telNumber" value="${staffModel.staffDTO.telNumber}" /></td>	
				<td><span id="stafftel-error" style="color:red"> </span></td>
			</tr>
			
			<tr>
				<td><form:label path="sex">Giới tính:</form:label></td>
				<td><form:select path="sex" value="${sex}">
				             <option value="1">Nam</option>
				             <option value="0">Nữ</option>
				</form:select></td>
			</tr>
			<tr>
				<td><form:label path="email">Email:</form:label></td>
				<td><form:input id ="staffemail" path="email" value="${staffModel.staffDTO.email}" /></td>
				<td><span id="staffemail-error" style="color:red"> </span></td>	
			</tr>
            <tr>
				<td><form:label path="positionID">Chức vụ:</form:label></td>
				<td><form:select path="positionID" value="${positionID}">
									<%
										ArrayList<WorkPlaymentDTO> positionList = (ArrayList<WorkPlaymentDTO>) staffModel.get("positions");
												if (positionList != null) {
													for (int i = 0; i < positionList.size(); i++) {
									%>
									<option value="<%=positionList.get(i).getId()%>"><%=positionList.get(i).getPosition()%></option>
									<%
										}
												}
									%>

								</form:select>
			</tr>
			<tr>
				<td><form:label path="income">Luong:</form:label></td>
				<td><form:input id= "staffincome" path="income"value="${staffModel.staffDTO.income}"></form:input></td>
				<td><span id="staffincome-error" style="color:red; display: none;" > </span></td>
			</tr>
			
			<tr>
				<td><form:label path="room_ID">Phòng ban:</form:label></td>
			    <td><form:select path="room_ID" value="${room_ID}">
			    <%
			    ArrayList<DivisionRoomDTO> roomList=(ArrayList<DivisionRoomDTO>) staffModel.get("listDivisionRoomDTO");
			    if(roomList!=null){
					for (int i = 0; i < roomList.size(); i++) {			 
				    %>
		            <option value="<%=roomList.get(i).getId()%>"><%=roomList.get(i).getRoomName()%></option>
		           <%}}%>
			    
			    </form:select>
			</tr>
				<tr>
					<td ><input id="editstaffsubmit" type="button" value="Cập nhật" /></td>
					<td ><input id="editstaffcancel" type="button" value="Hủy" /></td>
				</tr>
		 </table>
	     </form:form>

		</div>
</body>
</html>
